BEGIN;

CREATE TABLE school (
	id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
	object_state VARCHAR(30) NOT NULL,
	sid VARCHAR(32) NOT NULL,
	name VARCHAR(50) NOT NULL,
	type_id INT(11) NOT NULL,
	user_id INT(11) NOT NULL,
	street VARCHAR(35) NOT NULL,
	zip VARCHAR(5) NOT NULL,
	city VARCHAR(30) NOT NULL,
	FOREIGN KEY (user_id) REFERENCES user(id) ON DELETE CASCADE,
	FOREIGN KEY (type_id) REFERENCES school_type(id) ON DELETE NO ACTION,
	UNIQUE (sid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

COMMIT;